/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.service.persistence;

import com.liferay.portal.NoSuchModelException;
import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.BatchSessionUtil;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;

import doan.quanlycanbo.portlet.NoSuchhesoluongException;
import doan.quanlycanbo.portlet.model.hesoluong;
import doan.quanlycanbo.portlet.model.impl.hesoluongImpl;
import doan.quanlycanbo.portlet.model.impl.hesoluongModelImpl;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * The persistence implementation for the hesoluong service.
 *
 * <p>
 * Never modify or reference this class directly. Always use {@link hesoluongUtil} to access the hesoluong persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Nguyen Tuan Vinh
 * @see hesoluongPersistence
 * @see hesoluongUtil
 * @generated
 */
public class hesoluongPersistenceImpl extends BasePersistenceImpl<hesoluong>
	implements hesoluongPersistence {
	public static final String FINDER_CLASS_NAME_ENTITY = hesoluongImpl.class.getName();
	public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
		".List";
	public static final FinderPath FINDER_PATH_FIND_BY_G_L = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"findByG_L",
			new String[] {
				Long.class.getName(), String.class.getName(),
				
			"java.lang.Integer", "java.lang.Integer",
				"com.liferay.portal.kernel.util.OrderByComparator"
			});
	public static final FinderPath FINDER_PATH_COUNT_BY_G_L = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"countByG_L",
			new String[] { Long.class.getName(), String.class.getName() });
	public static final FinderPath FINDER_PATH_FIND_BY_NGACHLUONG = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"findByNgachLuong",
			new String[] {
				Long.class.getName(),
				
			"java.lang.Integer", "java.lang.Integer",
				"com.liferay.portal.kernel.util.OrderByComparator"
			});
	public static final FinderPath FINDER_PATH_COUNT_BY_NGACHLUONG = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"countByNgachLuong", new String[] { Long.class.getName() });
	public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"findAll", new String[0]);
	public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
			"countAll", new String[0]);

	/**
	 * Caches the hesoluong in the entity cache if it is enabled.
	 *
	 * @param hesoluong the hesoluong to cache
	 */
	public void cacheResult(hesoluong hesoluong) {
		EntityCacheUtil.putResult(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongImpl.class, hesoluong.getPrimaryKey(), hesoluong);
	}

	/**
	 * Caches the hesoluongs in the entity cache if it is enabled.
	 *
	 * @param hesoluongs the hesoluongs to cache
	 */
	public void cacheResult(List<hesoluong> hesoluongs) {
		for (hesoluong hesoluong : hesoluongs) {
			if (EntityCacheUtil.getResult(
						hesoluongModelImpl.ENTITY_CACHE_ENABLED,
						hesoluongImpl.class, hesoluong.getPrimaryKey(), this) == null) {
				cacheResult(hesoluong);
			}
		}
	}

	/**
	 * Clears the cache for all hesoluongs.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	public void clearCache() {
		CacheRegistryUtil.clear(hesoluongImpl.class.getName());
		EntityCacheUtil.clearCache(hesoluongImpl.class.getName());
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
	}

	/**
	 * Clears the cache for the hesoluong.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	public void clearCache(hesoluong hesoluong) {
		EntityCacheUtil.removeResult(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongImpl.class, hesoluong.getPrimaryKey());
	}

	/**
	 * Creates a new hesoluong with the primary key. Does not add the hesoluong to the database.
	 *
	 * @param mahesoluong the primary key for the new hesoluong
	 * @return the new hesoluong
	 */
	public hesoluong create(long mahesoluong) {
		hesoluong hesoluong = new hesoluongImpl();

		hesoluong.setNew(true);
		hesoluong.setPrimaryKey(mahesoluong);

		return hesoluong;
	}

	/**
	 * Removes the hesoluong with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param primaryKey the primary key of the hesoluong to remove
	 * @return the hesoluong that was removed
	 * @throws com.liferay.portal.NoSuchModelException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong remove(Serializable primaryKey)
		throws NoSuchModelException, SystemException {
		return remove(((Long)primaryKey).longValue());
	}

	/**
	 * Removes the hesoluong with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param mahesoluong the primary key of the hesoluong to remove
	 * @return the hesoluong that was removed
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong remove(long mahesoluong)
		throws NoSuchhesoluongException, SystemException {
		Session session = null;

		try {
			session = openSession();

			hesoluong hesoluong = (hesoluong)session.get(hesoluongImpl.class,
					new Long(mahesoluong));

			if (hesoluong == null) {
				if (_log.isWarnEnabled()) {
					_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + mahesoluong);
				}

				throw new NoSuchhesoluongException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
					mahesoluong);
			}

			return remove(hesoluong);
		}
		catch (NoSuchhesoluongException nsee) {
			throw nsee;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	protected hesoluong removeImpl(hesoluong hesoluong)
		throws SystemException {
		hesoluong = toUnwrappedModel(hesoluong);

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.delete(session, hesoluong);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

		EntityCacheUtil.removeResult(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongImpl.class, hesoluong.getPrimaryKey());

		return hesoluong;
	}

	public hesoluong updateImpl(
		doan.quanlycanbo.portlet.model.hesoluong hesoluong, boolean merge)
		throws SystemException {
		hesoluong = toUnwrappedModel(hesoluong);

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.update(session, hesoluong, merge);

			hesoluong.setNew(false);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

		EntityCacheUtil.putResult(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
			hesoluongImpl.class, hesoluong.getPrimaryKey(), hesoluong);

		return hesoluong;
	}

	protected hesoluong toUnwrappedModel(hesoluong hesoluong) {
		if (hesoluong instanceof hesoluongImpl) {
			return hesoluong;
		}

		hesoluongImpl hesoluongImpl = new hesoluongImpl();

		hesoluongImpl.setNew(hesoluong.isNew());
		hesoluongImpl.setPrimaryKey(hesoluong.getPrimaryKey());

		hesoluongImpl.setMahesoluong(hesoluong.getMahesoluong());
		hesoluongImpl.setGroupId(hesoluong.getGroupId());
		hesoluongImpl.setCompanyId(hesoluong.getCompanyId());
		hesoluongImpl.setLanguageId(hesoluong.getLanguageId());
		hesoluongImpl.setMangachluong(hesoluong.getMangachluong());
		hesoluongImpl.setBacluong(hesoluong.getBacluong());
		hesoluongImpl.setHesoluong(hesoluong.getHesoluong());

		return hesoluongImpl;
	}

	/**
	 * Finds the hesoluong with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
	 *
	 * @param primaryKey the primary key of the hesoluong to find
	 * @return the hesoluong
	 * @throws com.liferay.portal.NoSuchModelException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByPrimaryKey(Serializable primaryKey)
		throws NoSuchModelException, SystemException {
		return findByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Finds the hesoluong with the primary key or throws a {@link doan.quanlycanbo.portlet.NoSuchhesoluongException} if it could not be found.
	 *
	 * @param mahesoluong the primary key of the hesoluong to find
	 * @return the hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByPrimaryKey(long mahesoluong)
		throws NoSuchhesoluongException, SystemException {
		hesoluong hesoluong = fetchByPrimaryKey(mahesoluong);

		if (hesoluong == null) {
			if (_log.isWarnEnabled()) {
				_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + mahesoluong);
			}

			throw new NoSuchhesoluongException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				mahesoluong);
		}

		return hesoluong;
	}

	/**
	 * Finds the hesoluong with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param primaryKey the primary key of the hesoluong to find
	 * @return the hesoluong, or <code>null</code> if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong fetchByPrimaryKey(Serializable primaryKey)
		throws SystemException {
		return fetchByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Finds the hesoluong with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param mahesoluong the primary key of the hesoluong to find
	 * @return the hesoluong, or <code>null</code> if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong fetchByPrimaryKey(long mahesoluong)
		throws SystemException {
		hesoluong hesoluong = (hesoluong)EntityCacheUtil.getResult(hesoluongModelImpl.ENTITY_CACHE_ENABLED,
				hesoluongImpl.class, mahesoluong, this);

		if (hesoluong == null) {
			Session session = null;

			try {
				session = openSession();

				hesoluong = (hesoluong)session.get(hesoluongImpl.class,
						new Long(mahesoluong));
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (hesoluong != null) {
					cacheResult(hesoluong);
				}

				closeSession(session);
			}
		}

		return hesoluong;
	}

	/**
	 * Finds all the hesoluongs where groupId = &#63; and languageId = &#63;.
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @return the matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByG_L(long groupId, String languageId)
		throws SystemException {
		return findByG_L(groupId, languageId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}

	/**
	 * Finds a range of all the hesoluongs where groupId = &#63; and languageId = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @return the range of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByG_L(long groupId, String languageId,
		int start, int end) throws SystemException {
		return findByG_L(groupId, languageId, start, end, null);
	}

	/**
	 * Finds an ordered range of all the hesoluongs where groupId = &#63; and languageId = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByG_L(long groupId, String languageId,
		int start, int end, OrderByComparator orderByComparator)
		throws SystemException {
		Object[] finderArgs = new Object[] {
				groupId, languageId,
				
				String.valueOf(start), String.valueOf(end),
				String.valueOf(orderByComparator)
			};

		List<hesoluong> list = (List<hesoluong>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_L,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;

			if (orderByComparator != null) {
				query = new StringBundler(4 +
						(orderByComparator.getOrderByFields().length * 3));
			}
			else {
				query = new StringBundler(3);
			}

			query.append(_SQL_SELECT_HESOLUONG_WHERE);

			query.append(_FINDER_COLUMN_G_L_GROUPID_2);

			if (languageId == null) {
				query.append(_FINDER_COLUMN_G_L_LANGUAGEID_1);
			}
			else {
				if (languageId.equals(StringPool.BLANK)) {
					query.append(_FINDER_COLUMN_G_L_LANGUAGEID_3);
				}
				else {
					query.append(_FINDER_COLUMN_G_L_LANGUAGEID_2);
				}
			}

			if (orderByComparator != null) {
				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(groupId);

				if (languageId != null) {
					qPos.add(languageId);
				}

				list = (List<hesoluong>)QueryUtil.list(q, getDialect(), start,
						end);
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (list == null) {
					FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_G_L,
						finderArgs);
				}
				else {
					cacheResult(list);

					FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_L,
						finderArgs, list);
				}

				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Finds the first hesoluong in the ordered set where groupId = &#63; and languageId = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the first matching hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a matching hesoluong could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByG_L_First(long groupId, String languageId,
		OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		List<hesoluong> list = findByG_L(groupId, languageId, 0, 1,
				orderByComparator);

		if (list.isEmpty()) {
			StringBundler msg = new StringBundler(6);

			msg.append(_NO_SUCH_ENTITY_WITH_KEY);

			msg.append("groupId=");
			msg.append(groupId);

			msg.append(", languageId=");
			msg.append(languageId);

			msg.append(StringPool.CLOSE_CURLY_BRACE);

			throw new NoSuchhesoluongException(msg.toString());
		}
		else {
			return list.get(0);
		}
	}

	/**
	 * Finds the last hesoluong in the ordered set where groupId = &#63; and languageId = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the last matching hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a matching hesoluong could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByG_L_Last(long groupId, String languageId,
		OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		int count = countByG_L(groupId, languageId);

		List<hesoluong> list = findByG_L(groupId, languageId, count - 1, count,
				orderByComparator);

		if (list.isEmpty()) {
			StringBundler msg = new StringBundler(6);

			msg.append(_NO_SUCH_ENTITY_WITH_KEY);

			msg.append("groupId=");
			msg.append(groupId);

			msg.append(", languageId=");
			msg.append(languageId);

			msg.append(StringPool.CLOSE_CURLY_BRACE);

			throw new NoSuchhesoluongException(msg.toString());
		}
		else {
			return list.get(0);
		}
	}

	/**
	 * Finds the hesoluongs before and after the current hesoluong in the ordered set where groupId = &#63; and languageId = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mahesoluong the primary key of the current hesoluong
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the previous, current, and next hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong[] findByG_L_PrevAndNext(long mahesoluong, long groupId,
		String languageId, OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		hesoluong hesoluong = findByPrimaryKey(mahesoluong);

		Session session = null;

		try {
			session = openSession();

			hesoluong[] array = new hesoluongImpl[3];

			array[0] = getByG_L_PrevAndNext(session, hesoluong, groupId,
					languageId, orderByComparator, true);

			array[1] = hesoluong;

			array[2] = getByG_L_PrevAndNext(session, hesoluong, groupId,
					languageId, orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	protected hesoluong getByG_L_PrevAndNext(Session session,
		hesoluong hesoluong, long groupId, String languageId,
		OrderByComparator orderByComparator, boolean previous) {
		StringBundler query = null;

		if (orderByComparator != null) {
			query = new StringBundler(6 +
					(orderByComparator.getOrderByFields().length * 6));
		}
		else {
			query = new StringBundler(3);
		}

		query.append(_SQL_SELECT_HESOLUONG_WHERE);

		query.append(_FINDER_COLUMN_G_L_GROUPID_2);

		if (languageId == null) {
			query.append(_FINDER_COLUMN_G_L_LANGUAGEID_1);
		}
		else {
			if (languageId.equals(StringPool.BLANK)) {
				query.append(_FINDER_COLUMN_G_L_LANGUAGEID_3);
			}
			else {
				query.append(_FINDER_COLUMN_G_L_LANGUAGEID_2);
			}
		}

		if (orderByComparator != null) {
			String[] orderByFields = orderByComparator.getOrderByFields();

			if (orderByFields.length > 0) {
				query.append(WHERE_AND);
			}

			for (int i = 0; i < orderByFields.length; i++) {
				query.append(_ORDER_BY_ENTITY_ALIAS);
				query.append(orderByFields[i]);

				if ((i + 1) < orderByFields.length) {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(WHERE_GREATER_THAN_HAS_NEXT);
					}
					else {
						query.append(WHERE_LESSER_THAN_HAS_NEXT);
					}
				}
				else {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(WHERE_GREATER_THAN);
					}
					else {
						query.append(WHERE_LESSER_THAN);
					}
				}
			}

			query.append(ORDER_BY_CLAUSE);

			for (int i = 0; i < orderByFields.length; i++) {
				query.append(_ORDER_BY_ENTITY_ALIAS);
				query.append(orderByFields[i]);

				if ((i + 1) < orderByFields.length) {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(ORDER_BY_ASC_HAS_NEXT);
					}
					else {
						query.append(ORDER_BY_DESC_HAS_NEXT);
					}
				}
				else {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(ORDER_BY_ASC);
					}
					else {
						query.append(ORDER_BY_DESC);
					}
				}
			}
		}

		String sql = query.toString();

		Query q = session.createQuery(sql);

		q.setFirstResult(0);
		q.setMaxResults(2);

		QueryPos qPos = QueryPos.getInstance(q);

		qPos.add(groupId);

		if (languageId != null) {
			qPos.add(languageId);
		}

		if (orderByComparator != null) {
			Object[] values = orderByComparator.getOrderByValues(hesoluong);

			for (Object value : values) {
				qPos.add(value);
			}
		}

		List<hesoluong> list = q.list();

		if (list.size() == 2) {
			return list.get(1);
		}
		else {
			return null;
		}
	}

	/**
	 * Finds all the hesoluongs where mangachluong = &#63;.
	 *
	 * @param mangachluong the mangachluong to search with
	 * @return the matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByNgachLuong(long mangachluong)
		throws SystemException {
		return findByNgachLuong(mangachluong, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}

	/**
	 * Finds a range of all the hesoluongs where mangachluong = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mangachluong the mangachluong to search with
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @return the range of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByNgachLuong(long mangachluong, int start,
		int end) throws SystemException {
		return findByNgachLuong(mangachluong, start, end, null);
	}

	/**
	 * Finds an ordered range of all the hesoluongs where mangachluong = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mangachluong the mangachluong to search with
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findByNgachLuong(long mangachluong, int start,
		int end, OrderByComparator orderByComparator) throws SystemException {
		Object[] finderArgs = new Object[] {
				mangachluong,
				
				String.valueOf(start), String.valueOf(end),
				String.valueOf(orderByComparator)
			};

		List<hesoluong> list = (List<hesoluong>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_NGACHLUONG,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;

			if (orderByComparator != null) {
				query = new StringBundler(3 +
						(orderByComparator.getOrderByFields().length * 3));
			}
			else {
				query = new StringBundler(2);
			}

			query.append(_SQL_SELECT_HESOLUONG_WHERE);

			query.append(_FINDER_COLUMN_NGACHLUONG_MANGACHLUONG_2);

			if (orderByComparator != null) {
				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(mangachluong);

				list = (List<hesoluong>)QueryUtil.list(q, getDialect(), start,
						end);
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (list == null) {
					FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_NGACHLUONG,
						finderArgs);
				}
				else {
					cacheResult(list);

					FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_NGACHLUONG,
						finderArgs, list);
				}

				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Finds the first hesoluong in the ordered set where mangachluong = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mangachluong the mangachluong to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the first matching hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a matching hesoluong could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByNgachLuong_First(long mangachluong,
		OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		List<hesoluong> list = findByNgachLuong(mangachluong, 0, 1,
				orderByComparator);

		if (list.isEmpty()) {
			StringBundler msg = new StringBundler(4);

			msg.append(_NO_SUCH_ENTITY_WITH_KEY);

			msg.append("mangachluong=");
			msg.append(mangachluong);

			msg.append(StringPool.CLOSE_CURLY_BRACE);

			throw new NoSuchhesoluongException(msg.toString());
		}
		else {
			return list.get(0);
		}
	}

	/**
	 * Finds the last hesoluong in the ordered set where mangachluong = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mangachluong the mangachluong to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the last matching hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a matching hesoluong could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong findByNgachLuong_Last(long mangachluong,
		OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		int count = countByNgachLuong(mangachluong);

		List<hesoluong> list = findByNgachLuong(mangachluong, count - 1, count,
				orderByComparator);

		if (list.isEmpty()) {
			StringBundler msg = new StringBundler(4);

			msg.append(_NO_SUCH_ENTITY_WITH_KEY);

			msg.append("mangachluong=");
			msg.append(mangachluong);

			msg.append(StringPool.CLOSE_CURLY_BRACE);

			throw new NoSuchhesoluongException(msg.toString());
		}
		else {
			return list.get(0);
		}
	}

	/**
	 * Finds the hesoluongs before and after the current hesoluong in the ordered set where mangachluong = &#63;.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param mahesoluong the primary key of the current hesoluong
	 * @param mangachluong the mangachluong to search with
	 * @param orderByComparator the comparator to order the set by
	 * @return the previous, current, and next hesoluong
	 * @throws doan.quanlycanbo.portlet.NoSuchhesoluongException if a hesoluong with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public hesoluong[] findByNgachLuong_PrevAndNext(long mahesoluong,
		long mangachluong, OrderByComparator orderByComparator)
		throws NoSuchhesoluongException, SystemException {
		hesoluong hesoluong = findByPrimaryKey(mahesoluong);

		Session session = null;

		try {
			session = openSession();

			hesoluong[] array = new hesoluongImpl[3];

			array[0] = getByNgachLuong_PrevAndNext(session, hesoluong,
					mangachluong, orderByComparator, true);

			array[1] = hesoluong;

			array[2] = getByNgachLuong_PrevAndNext(session, hesoluong,
					mangachluong, orderByComparator, false);

			return array;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	protected hesoluong getByNgachLuong_PrevAndNext(Session session,
		hesoluong hesoluong, long mangachluong,
		OrderByComparator orderByComparator, boolean previous) {
		StringBundler query = null;

		if (orderByComparator != null) {
			query = new StringBundler(6 +
					(orderByComparator.getOrderByFields().length * 6));
		}
		else {
			query = new StringBundler(3);
		}

		query.append(_SQL_SELECT_HESOLUONG_WHERE);

		query.append(_FINDER_COLUMN_NGACHLUONG_MANGACHLUONG_2);

		if (orderByComparator != null) {
			String[] orderByFields = orderByComparator.getOrderByFields();

			if (orderByFields.length > 0) {
				query.append(WHERE_AND);
			}

			for (int i = 0; i < orderByFields.length; i++) {
				query.append(_ORDER_BY_ENTITY_ALIAS);
				query.append(orderByFields[i]);

				if ((i + 1) < orderByFields.length) {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(WHERE_GREATER_THAN_HAS_NEXT);
					}
					else {
						query.append(WHERE_LESSER_THAN_HAS_NEXT);
					}
				}
				else {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(WHERE_GREATER_THAN);
					}
					else {
						query.append(WHERE_LESSER_THAN);
					}
				}
			}

			query.append(ORDER_BY_CLAUSE);

			for (int i = 0; i < orderByFields.length; i++) {
				query.append(_ORDER_BY_ENTITY_ALIAS);
				query.append(orderByFields[i]);

				if ((i + 1) < orderByFields.length) {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(ORDER_BY_ASC_HAS_NEXT);
					}
					else {
						query.append(ORDER_BY_DESC_HAS_NEXT);
					}
				}
				else {
					if (orderByComparator.isAscending() ^ previous) {
						query.append(ORDER_BY_ASC);
					}
					else {
						query.append(ORDER_BY_DESC);
					}
				}
			}
		}

		String sql = query.toString();

		Query q = session.createQuery(sql);

		q.setFirstResult(0);
		q.setMaxResults(2);

		QueryPos qPos = QueryPos.getInstance(q);

		qPos.add(mangachluong);

		if (orderByComparator != null) {
			Object[] values = orderByComparator.getOrderByValues(hesoluong);

			for (Object value : values) {
				qPos.add(value);
			}
		}

		List<hesoluong> list = q.list();

		if (list.size() == 2) {
			return list.get(1);
		}
		else {
			return null;
		}
	}

	/**
	 * Finds all the hesoluongs.
	 *
	 * @return the hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findAll() throws SystemException {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}

	/**
	 * Finds a range of all the hesoluongs.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @return the range of hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findAll(int start, int end)
		throws SystemException {
		return findAll(start, end, null);
	}

	/**
	 * Finds an ordered range of all the hesoluongs.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of hesoluongs to return
	 * @param end the upper bound of the range of hesoluongs to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public List<hesoluong> findAll(int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		Object[] finderArgs = new Object[] {
				String.valueOf(start), String.valueOf(end),
				String.valueOf(orderByComparator)
			};

		List<hesoluong> list = (List<hesoluong>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;
			String sql = null;

			if (orderByComparator != null) {
				query = new StringBundler(2 +
						(orderByComparator.getOrderByFields().length * 3));

				query.append(_SQL_SELECT_HESOLUONG);

				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);

				sql = query.toString();
			}
			else {
				sql = _SQL_SELECT_HESOLUONG;
			}

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				if (orderByComparator == null) {
					list = (List<hesoluong>)QueryUtil.list(q, getDialect(),
							start, end, false);

					Collections.sort(list);
				}
				else {
					list = (List<hesoluong>)QueryUtil.list(q, getDialect(),
							start, end);
				}
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (list == null) {
					FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL,
						finderArgs);
				}
				else {
					cacheResult(list);

					FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs,
						list);
				}

				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Removes all the hesoluongs where groupId = &#63; and languageId = &#63; from the database.
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @throws SystemException if a system exception occurred
	 */
	public void removeByG_L(long groupId, String languageId)
		throws SystemException {
		for (hesoluong hesoluong : findByG_L(groupId, languageId)) {
			remove(hesoluong);
		}
	}

	/**
	 * Removes all the hesoluongs where mangachluong = &#63; from the database.
	 *
	 * @param mangachluong the mangachluong to search with
	 * @throws SystemException if a system exception occurred
	 */
	public void removeByNgachLuong(long mangachluong) throws SystemException {
		for (hesoluong hesoluong : findByNgachLuong(mangachluong)) {
			remove(hesoluong);
		}
	}

	/**
	 * Removes all the hesoluongs from the database.
	 *
	 * @throws SystemException if a system exception occurred
	 */
	public void removeAll() throws SystemException {
		for (hesoluong hesoluong : findAll()) {
			remove(hesoluong);
		}
	}

	/**
	 * Counts all the hesoluongs where groupId = &#63; and languageId = &#63;.
	 *
	 * @param groupId the group id to search with
	 * @param languageId the language id to search with
	 * @return the number of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public int countByG_L(long groupId, String languageId)
		throws SystemException {
		Object[] finderArgs = new Object[] { groupId, languageId };

		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_L,
				finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(3);

			query.append(_SQL_COUNT_HESOLUONG_WHERE);

			query.append(_FINDER_COLUMN_G_L_GROUPID_2);

			if (languageId == null) {
				query.append(_FINDER_COLUMN_G_L_LANGUAGEID_1);
			}
			else {
				if (languageId.equals(StringPool.BLANK)) {
					query.append(_FINDER_COLUMN_G_L_LANGUAGEID_3);
				}
				else {
					query.append(_FINDER_COLUMN_G_L_LANGUAGEID_2);
				}
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(groupId);

				if (languageId != null) {
					qPos.add(languageId);
				}

				count = (Long)q.uniqueResult();
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (count == null) {
					count = Long.valueOf(0);
				}

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_L, finderArgs,
					count);

				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Counts all the hesoluongs where mangachluong = &#63;.
	 *
	 * @param mangachluong the mangachluong to search with
	 * @return the number of matching hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public int countByNgachLuong(long mangachluong) throws SystemException {
		Object[] finderArgs = new Object[] { mangachluong };

		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_NGACHLUONG,
				finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(2);

			query.append(_SQL_COUNT_HESOLUONG_WHERE);

			query.append(_FINDER_COLUMN_NGACHLUONG_MANGACHLUONG_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(mangachluong);

				count = (Long)q.uniqueResult();
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (count == null) {
					count = Long.valueOf(0);
				}

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_NGACHLUONG,
					finderArgs, count);

				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Counts all the hesoluongs.
	 *
	 * @return the number of hesoluongs
	 * @throws SystemException if a system exception occurred
	 */
	public int countAll() throws SystemException {
		Object[] finderArgs = new Object[0];

		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
				finderArgs, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_HESOLUONG);

				count = (Long)q.uniqueResult();
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (count == null) {
					count = Long.valueOf(0);
				}

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
					count);

				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Initializes the hesoluong persistence.
	 */
	public void afterPropertiesSet() {
		String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
					com.liferay.util.service.ServiceProps.get(
						"value.object.listener.doan.quanlycanbo.portlet.model.hesoluong")));

		if (listenerClassNames.length > 0) {
			try {
				List<ModelListener<hesoluong>> listenersList = new ArrayList<ModelListener<hesoluong>>();

				for (String listenerClassName : listenerClassNames) {
					listenersList.add((ModelListener<hesoluong>)InstanceFactory.newInstance(
							listenerClassName));
				}

				listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
			}
			catch (Exception e) {
				_log.error(e);
			}
		}
	}

	public void destroy() {
		EntityCacheUtil.removeCache(hesoluongImpl.class.getName());
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
	}

	@BeanReference(type = khoidonviquanlyPersistence.class)
	protected khoidonviquanlyPersistence khoidonviquanlyPersistence;
	@BeanReference(type = donviPersistence.class)
	protected donviPersistence donviPersistence;
	@BeanReference(type = chucvuPersistence.class)
	protected chucvuPersistence chucvuPersistence;
	@BeanReference(type = capuyPersistence.class)
	protected capuyPersistence capuyPersistence;
	@BeanReference(type = danhhieuPersistence.class)
	protected danhhieuPersistence danhhieuPersistence;
	@BeanReference(type = dantocPersistence.class)
	protected dantocPersistence dantocPersistence;
	@BeanReference(type = hochamPersistence.class)
	protected hochamPersistence hochamPersistence;
	@BeanReference(type = hocviPersistence.class)
	protected hocviPersistence hocviPersistence;
	@BeanReference(type = tongiaoPersistence.class)
	protected tongiaoPersistence tongiaoPersistence;
	@BeanReference(type = xuatthanPersistence.class)
	protected xuatthanPersistence xuatthanPersistence;
	@BeanReference(type = giaoducphothongPersistence.class)
	protected giaoducphothongPersistence giaoducphothongPersistence;
	@BeanReference(type = ngachluongPersistence.class)
	protected ngachluongPersistence ngachluongPersistence;
	@BeanReference(type = hesoluongPersistence.class)
	protected hesoluongPersistence hesoluongPersistence;
	@BeanReference(type = hosoPersistence.class)
	protected hosoPersistence hosoPersistence;
	@BeanReference(type = sachxuatbanPersistence.class)
	protected sachxuatbanPersistence sachxuatbanPersistence;
	@BeanReference(type = dienbienhochamPersistence.class)
	protected dienbienhochamPersistence dienbienhochamPersistence;
	@BeanReference(type = dienbienhocviPersistence.class)
	protected dienbienhocviPersistence dienbienhocviPersistence;
	@BeanReference(type = dienbienluongPersistence.class)
	protected dienbienluongPersistence dienbienluongPersistence;
	@BeanReference(type = quatrinhdinuocngoaiPersistence.class)
	protected quatrinhdinuocngoaiPersistence quatrinhdinuocngoaiPersistence;
	@BeanReference(type = quatrinhnghiencuuPersistence.class)
	protected quatrinhnghiencuuPersistence quatrinhnghiencuuPersistence;
	@BeanReference(type = ResourcePersistence.class)
	protected ResourcePersistence resourcePersistence;
	@BeanReference(type = UserPersistence.class)
	protected UserPersistence userPersistence;
	private static final String _SQL_SELECT_HESOLUONG = "SELECT hesoluong FROM hesoluong hesoluong";
	private static final String _SQL_SELECT_HESOLUONG_WHERE = "SELECT hesoluong FROM hesoluong hesoluong WHERE ";
	private static final String _SQL_COUNT_HESOLUONG = "SELECT COUNT(hesoluong) FROM hesoluong hesoluong";
	private static final String _SQL_COUNT_HESOLUONG_WHERE = "SELECT COUNT(hesoluong) FROM hesoluong hesoluong WHERE ";
	private static final String _FINDER_COLUMN_G_L_GROUPID_2 = "hesoluong.groupId = ? AND ";
	private static final String _FINDER_COLUMN_G_L_LANGUAGEID_1 = "hesoluong.languageId IS NULL";
	private static final String _FINDER_COLUMN_G_L_LANGUAGEID_2 = "hesoluong.languageId = ?";
	private static final String _FINDER_COLUMN_G_L_LANGUAGEID_3 = "(hesoluong.languageId IS NULL OR hesoluong.languageId = ?)";
	private static final String _FINDER_COLUMN_NGACHLUONG_MANGACHLUONG_2 = "hesoluong.mangachluong = ?";
	private static final String _ORDER_BY_ENTITY_ALIAS = "hesoluong.";
	private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No hesoluong exists with the primary key ";
	private static final String _NO_SUCH_ENTITY_WITH_KEY = "No hesoluong exists with the key {";
	private static Log _log = LogFactoryUtil.getLog(hesoluongPersistenceImpl.class);
}